#!/usr/bin/python
# -*- coding: utf-8 -*-
# File: events.py
# Author: Tomás Vírseda
# License: GPL v3
# Description: Event manager for Vazaar

import os

import gobject
import gtk

from vazaarlib.utils import get_logger

class EventManager():
    def __init__(self, gui):
        self.gui = gui
        self.log = get_logger("ActionMgr")

    def configure_event(self, data1=None, data2=None):
        self.width, self.height = self.gui.frontend['mainwin'].get_size()

        return False

    def on_key_press(self, widget, event):
        keyname = gtk.gdk.keyval_name(event.keyval)
        if keyname == 'Escape':
            self.gui.actions.hide_application()
